<div class="titlebar">
    <div class="fn-left"><i class="iconfont icon-line-chart_icon"></i> 数据统计</div>
    <div class="fn-right">
        <form class="input-group" id="form" action="{:url('store.index/index',['types' => 0])}">
            <input placeholder="开始时间" class="input w100 ui-date" type="text" name="starttime" readonly autocomplete="false" value="{$starttime}"/>
            <input placeholder="结束时间" class="input w100 ui-date" type="text" name="endtime" readonly autocomplete="false" value="{$endtime}"/>
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-right button-group">
        <a href="{:url('store.index/index',['time' => 1,'types'=>0])}" class="button {$time==1?'button-violet':''}">今日</a>
        <a href="{:url('store.index/index',['time' => 2,'types'=>0])}" class="button {$time==2?'button-violet':''}">昨日</a>
        <a href="{:url('store.index/index',['time' => 30,'types'=>0])}" class="button {$time==30?'button-violet':''}"">本月</a>
        <a href="{:url('store.index/index',['time' => 60,'types'=>0])}" class="button {$time==60?'button-violet':''}"">上月</a>
    </div>
</div>
<div class="titlebar"><i class="iconfont icon-text_icon"></i>好店列表</div>
<div id="actionbar">
    <div class="fn-left">
        <a href="{:url('store.index/edit')}" class="button button-blue"> <i class="iconfont icon-add_icon"></i>增加商户</a>
    </div>
    <div class="fn-right">
        <form class="input-group" id="form" action="{:url('store.index/index')}" method="get">
            <input placeholder="请输入好店名称" class="input w200" type="text" name="keyword" value="{$keyword}" />
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-right">
        <a href="{:url('store.index/index',['types'=>0,'time'=>$time,'starttime' => $starttime,'endtime' => $endtime])}" class="button{if $types == 0} button-green{/if}">全部</a>
        <a href="{:url('store.index/index',['types'=>1,'time'=>$time,'starttime' => $starttime,'endtime' => $endtime])}" class="button{if $types == 1} button-green{/if}">正常</a>
        <a href="{:url('store.index/index',['types'=>2,'time'=>$time,'starttime' => $starttime,'endtime' => $endtime])}" class="button{if $types == 2} button-green{/if}">锁定</a>
    </div>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th class="w60 fn-tac">排序</th>
            <th class="w60 fn-tac"></th>
            <th>好店名称</th>
            <th>老板</th>
            <th class="w60 fn-tac">状态</th>
            <th class="w140 fn-tac">更新时间</th>
            <th class="w220 fn-tac">操作</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td class="fn-tac"><input name="sort" class="fn-tac w40 input input-mini" type="text" value="{$vo['sort']}" id="{$vo.id}" /></td>
            <td class="fn-tac"><img src="{$vo.img}" class="w40" /></td>
            <td>
                <i class="iconfont icon-home_icon"></i><a href="javascript:;" url="{:url('store.index/review',['id'=>$vo.id])}" class="fn-fb selectID">{$vo.name}</a><br />
                <i class="iconfont icon-address_icon"></i><span class="gray">{$vo.address}</span>
            </td>
            <td><img src="{$vo.user.face}" class="w40 fn-left" style="border-radius: 5px;"/><div class="fn-left m10">{$vo.user.nickname}</div></td>
            <td>
                <a class="istop" url="{:url('store.index/istop',['id'=>$vo.id])}" href="javascript:;" title="置顶/取消">{if $vo.is_top}<span class="badge bg-green">置顶</span>{else}<span class="badge">置顶</span>{/if}</a><br />
                <a class="istop" url="{:url('store.index/islock',['id'=>$vo.id])}" href="javascript:;" title="置顶/取消">{if $vo.is_lock}<span class="badge bg-red">锁定</span>{else}<span class="badge">锁定</span>{/if}</a>
            </td>
            <td class="fn-tac">{$vo.create_time|date='Y-m-d H:i'}</td>
            <td class="button-group">
                <a class="button" href="{:url('store.chain/index',['store_id'=>$vo.id])}"><i class="iconfont icon-store_icon"></i>门店</a>
                <a class="button" href="{:url('store.index/edit',['id'=>$vo.id])}"><i class="iconfont icon-edit"></i>编辑</a>
                <a class="button isDel" url="{:url('store.index/delete',['id'=>$vo.id])}" href="javascript:;"><i class="iconfont icon-lajixiang"></i>删除</a>
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base','form','layer','tip','date', function () {
    $('#form').isForm({types:1});
    $('.isDel').isDel();
    sort("{:url('store.index/sort')}");
    $('.istop').click(function () {
        var url = $(this).attr("url");
        parent.layer.confirm('确认要设置当前用户?',{ icon: 3,title: '友情提示' }, function (index) {
            $.getJSON(url, function (data) {window.location.reload();});
            parent.layer.close(index);
        });
    })
    $(".selectID").win();
})
</script>